1. Field of the Invention
The present invention relates to a data insertion circuit and data insertion method for inserting data into compressed image data, etc.
2. Description of the Related Art
Conventionally, data insertion circuits have been used for inserting data, including a digital watermark, etc., into compressed digital image data.
The structure of a conventional data insertion circuit will be described with reference to FIG. 6.
A data insertion circuit 3 shown in FIG. 6 is prepared for inserting predetermined data into digital image data which has been compressed according to the MPEG-2 (Moving Pictures Experts Group 2) standard. A VLD (Variable Length Decoder) 101 decodes data which has been variable-length coded. A data generator 102 generates data to be inserted into the compressed image data. A multiplication unit 103 adjusts an insertion degree at which the target data to be inserted is inserted into image data. An adder 104 adds target data to the original compressed image data. A VLC 105 (Variable Length Coder) 105 variable-length codes target data. A selector 106 selects either one of the variable-length coded data of the original data to which the data has been inserted and the original variable-length coded data.
Operations of the data insertion circuit 3 will now be described. The compressed MPEG2 data is variable-length coded. The VLD 101 decodes the supplied MPEG2 data so as to generate a RUN and Level.
Target data to be inserted to the image data is generated by the data generator 102. Thus generated data is multiplied by a constant number (an insertion degree at which target data is inserted into image data) by the multiplication unit 103, thereafter to be added to the Level by the adder 104. By this addition, data including a digital watermark, etc. is inserted into the image data. The Level including the data added to it and the original RUN are variable-length coded by the VLC 105 so as to be set as MPEG2 data. Since the Level has been changed in its data contents, the code length of the variable-length coded data may differ from the code length (the code length of the original MPEG2 data) of the original data. Hence, if the MPEG2 data which is variable-length coded is used as is, the data length of the entire MPEG2 data may change, resulting in forming damaged MPEG2 data. In consideration of this, the selector 106 selects and outputs a VLC code into which data is inserted, if the code length of the MPEG2 data has not been changed from the original code length. On the contrary, the selector 106 selects and outputs the original code, if the code length of the MPEG2 data has been changed from the original code length somehow.
The data which has been inserted into the image data is detected by a non-illustrative detector. However, depending on the original MPEG2 data, the inserted data may not be detected. This may occur in the case where the code length of the inserted data is unlikely to coincide with the code length of the original data, and/or where the original image data is rarely replaced with the image data into which data is inserted.
In such cases, the multiplier of the multiplication unit 103 is increased, and a large amount of data is inserted into the image data. Then, it is necessary that the amount of data to be inserted into the entire image data is increased, so as to appropriately detect the inserted data.
To desirably insert data into image data with the utilization of the conventional data insertion circuit, it is necessary to:
1) insert the data into the image data;
2) pass output data to a detector, and check whether the inserted data can be detected; and
3) increase an insertion degree (increase a value of the data to be inserted) and try to insert the data again, if the data could not be detected. The conventional data insertion circuit can not be adopted to a system which executes the insertion process in real time.
Further techniques for inserting arbitrary data into image data arc disclosed in Unexamined Japanese Patent Applications KOKAI Publication Nos. H10-243398, H11-55639, H11-34145. None of the above techniques include a system for executing the insertion process in real time.